package com.huaxingbankas.modules.daoimpl;

import org.springframework.stereotype.Repository;

import com.huaxingbankas.core.base.dao.BaseDAO;
import com.huaxingbankas.core.base.search.Filter;
import com.huaxingbankas.core.base.search.Search;
import com.huaxingbankas.modules.dao.User_Dao;
import com.huaxingbankas.modules.model.backup.User;
@Repository
public class UserDaoImpl extends BaseDAO<User, Integer> implements User_Dao {


	@Override
	public boolean findByObject(User user) {
		return false;
	}


	@Override
	public User findByUsername(User user) {
		// TODO Auto-generated method stub
		Filter f = new Filter();
		f.setProperty("username");
		f.setOperator(Filter.OP_EQUAL);
		f.setValue(user.getUsername());
		Search search = new Search();
		search.addField("username"); 
		search.addFilter(f);
		User users = super.searchUnique(search);
		
		return users;
	}

    
}